# Author：liyimei
# Time：2023/5/17 11:47
from selenium import webdriver
# 导入显示等待
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# 显示等待针对的是某一个标签的状态
# 检测百度首页的title是不是'百度一下，你就知道'
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
driver.maximize_window()

# 等待True,超时没有返回True,就抛出异常
result = WebDriverWait(driver,10).until(EC.title_is('百度一下，你就知道'),message='标题不一致')
print(result)